<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			
			function imgLoad()
			{
				console.log("imgLoad()")
				document.images[0].onerror = function(){
					alert("图像不存在");
				}
				document.images[0].src = "test.gif";
			}
		</script>
	</head>
	<body onload="imgLoad()">
		<script type="text/javascript">
			
			// onerror 事件
			window.onerror = function(ms,url,line)
			{
				alert("函数"+ms +"\n"+url+"\n"+line);
				return true;
			}
			
			faa();
			
			function foo()
			{
				console.log("foo()");
			}
		</script>
		
		<img />
	</body>
</html>
